﻿<?xml version="1.0" encoding="utf-8" ?>
<Feature id="FilterSort">


	<BusinessRules>
		<!---ExchangeRate Bizrules-->
		<BusinessRule name="addUpdateFilterSortSave" security="disabled">
			<LocalClass name="FilterSort.FilterSortBizRules,ScsCore" />
		</BusinessRule>

		<BusinessRule name="deleteFilterSortSave" security="disabled">
			<LocalClass name="FilterSort.FilterSortBizRules,ScsCore" />
		</BusinessRule>

		<BusinessRule name="getFilterSortSaves" security="disabled">
			<LocalClass name="FilterSort.FilterSortBizRules,ScsCore" />
		</BusinessRule>

		<BusinessRule name="getFilterSortSaveDetails" security="disabled">
			<LocalClass name="FilterSort.FilterSortBizRules,ScsCore" />
		</BusinessRule>

		<BusinessRule name="getFilterSortGroupDetails" security="disabled">
			<LocalClass name="FilterSort.FilterSortBizRules,ScsCore" />
		</BusinessRule>

		<BusinessRule name="getFilterFieldOptions" security="disabled">
			<LocalClass name="FilterSort.FilterSortBizRules,ScsCore" />
		</BusinessRule>

	</BusinessRules>
	
	<BusinessRules>
		<BusinessRule name="getArticleKeywordSetKeywords" security="disabled">
			<LocalClass name="FilterSort.ArticleKeywordBizRules,ScsCore" />
		</BusinessRule>
		<BusinessRule name="updateArticleSetKeyword" security="disabled">
			<LocalClass name="FilterSort.ArticleKeywordBizRules,ScsCore" />
		</BusinessRule>
		<BusinessRule name="deleteArticleSetKeyword" security="disabled">
			<LocalClass name="FilterSort.ArticleKeywordBizRules,ScsCore" />
		</BusinessRule>
		<BusinessRule name="updateArticleKeywordSet" security="disabled">
			<LocalClass name="FilterSort.ArticleKeywordBizRules,ScsCore" />
		</BusinessRule>
		<BusinessRule name="deleteArticleKeywordSet" security="disabled">
			<LocalClass name="FilterSort.ArticleKeywordBizRules,ScsCore" />
		</BusinessRule>
		<BusinessRule name="updateArticleKeywordMatchSet" security="disabled">
			<LocalClass name="FilterSort.ArticleKeywordBizRules,ScsCore" />
		</BusinessRule>
		<BusinessRule name="createNewArticleMatchSetIfNotExist" security="disabled">
			<LocalClass name="FilterSort.ArticleKeywordBizRules,ScsCore" />
		</BusinessRule>
		<BusinessRule name="getFilterSortCriteriaFromKeyword" security="disabled">
			<LocalClass name="FilterSort.ArticleKeywordBizRules,ScsCore" />
		</BusinessRule>
	</BusinessRules>

	

	<BusinessObjects>
		<BusinessObject type="FilterSortOptions">
			<Field name="groupId" type="Guid" />
			<Field name="filterOptions" type="List(FilterCriteria)" />
			<Field name="filterIsAnd" type="Boolean">True</Field>
			<Field name="sortOptions" type="List(SortCriteria)" />
		</BusinessObject>

		<BusinessObject type="FilterCriteria">
			<Field name="field" type="String" />
			<Field name="criteria" type="String" />
			<Field name="value" type="String" />
		</BusinessObject>

		<BusinessObject type="SortCriteria">
			<Field name="field" type="String" />
			<Field name="isAsc" type="Boolean">True</Field>
		</BusinessObject>

		<BusinessObject type="FilterSortSaveInfo" key="id">
			<Field name="id" type="Guid" />
			<Field name="name" type="String" />
			<Field name="groupName" type="String"/>
			<Field name="associatedId" type="Guid" />
			<Field name="isCompanyLevel" type="Boolean" />
			<Field name="options" type="FilterSortOptions" />
		</BusinessObject>

		<BusinessObject type="FilterSortDbData" key="id" extends="FilterSortSaveInfo">
			<Field name="FilterSortOptionsData" type="String"/>
	    </BusinessObject>

		<BusinessObject type="FilterSortGroupConfig" key="id">
			<Field name="id" type="Guid" />
			<Field name="fieldOptions" type="List(FilterFieldOptions)" />
		</BusinessObject>

		<BusinessObject type="FilterFieldOptions" key="value">
			<Field name="name" type="String" />
			<Field name="value" type="String" />
			<Field name="defaultEditor" type="String" />
			<Field name="criteria" type="List(CriteriaConfig)" />
		</BusinessObject>

		<BusinessObject type="CriteriaConfig">
			<Field name="name" type="String" />
			<Field name="value" type="String" />
			<Field name="editor" type="String" />
		</BusinessObject>
	</BusinessObjects>

	<BusinessObjects>
		<BusinessObject type="ArticleKeywordSet" key="id">
			<Field name="id" type="Guid" />
			<Field name="name" type="String" />
			<Field name="companyId" type="Guid"><NULL/></Field>
		</BusinessObject>
		<BusinessObject type="ArticleKeyword" key="id">
			<Field name="id" type="Guid" />
			<Field name="keywordSetId" type="Guid" />
			<Field name="displayName" type="String" />
			<Field name="keyword" type="String" />
			<Field name="articleMatchCount" type="Integer" />

			<Method name="name" language="jscript.NET"><![CDATA[
				var dn = self.getItem("displayName");
				if(Cmn.IsEmpty(dn))
					dn = self.getItem("keyword");
				return dn;
			]]></Method>			
			<Field name="companyId" type="Guid"><NULL/></Field>
			<Field name="depth" type="Integer"/>
			<Field name="onlyCatagories" type="Boolean" />
		</BusinessObject>
	</BusinessObjects>
		
	<ApplicationData>
		<Entry name="filterSortOptions" type="Swaf.Container.FlexiMap" />
	</ApplicationData>
	
	<ClassFactory id="BizProcs">
		<Class type="FilterSort.Gui.FilterSortBizProc,ScsCore" name="FilterSortManager"/>
		<Class type="FilterSort.Gui.FilterCriteriaBizProc,ScsCore" name="FilterCriteria"/>
		<Class type="FilterSort.Gui.KeywordSetKeywordsBizProc,ScsCore" name="filterKeywords" />
		<Class type="FilterSort.Gui.ArticleSearchBizProc,ScsCore" name="basicSearch" />
	</ClassFactory>

</Feature>